#ifndef STL_PARSER_HPP
#define STL_PARSER_HPP

#include  <vector>
#include <fstream>


using namespace std;


class stl_parser
 {
 public:
   stl_parser()
   {
       
    
   }
   virtual ~stl_parser()
   {
   }
   
   stl_parser(string filename):in(filename.c_str()){
         
   }
   bool parse();

   void file(string filename)
   {
     in.open(filename.c_str());
   }
   
   
   
   virtual void got_triangle(vector<double>&){};
   
 private:
   bool cmp(const string &a, const string &b);
   bool parse_facet();
   bool parse_header();
   bool readvertex(double &x,double &y,double &z);

   

    /*string
   t_solid,t_normal,t_facet,t_outer,t_loop,t_vertex;
   */
   vector<double> triangle;

   string name;
   
   ifstream in;
};

#endif
